package com.mrkun.vueshop.service;


import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mrkun.vueshop.mapper.UserMapper;
import com.mrkun.vueshop.model.User;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author by yong
 * @date 2020/3/17
 */
@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public PageInfo<User> getPageUser(Integer page, Integer size,String searchName){
        PageHelper.startPage(page,size);

        List<User> allUser = userMapper.findAllUser(searchName);
        PageInfo<User> userPageInfo = new PageInfo<>(allUser);
        return userPageInfo;
    }
}
